package com.easy.frame.base.service.config;

import io.seata.spring.annotation.GlobalTransactionScanner;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 分布式事务seata配置类
 *
 * @author zzf
 * @date 2020/8/3 16:29
 */


@Configuration
public class SeataConfig {

    @Value("${spring.application.name}")
    private String applicationName;

    private String txServiceGroup = "my_test_tx_group";

    @Bean
    public GlobalTransactionScanner scanner() {
        return new GlobalTransactionScanner(applicationName, txServiceGroup);
    }

}